package com.woniuxy.tmsdriverassignment.service.imp;

import com.woniuxy.tmsdriverassignment.domain.Contract;
import com.woniuxy.tmsdriverassignment.mapper.ContractMapper;
import com.woniuxy.tmsdriverassignment.service.ContractService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO:
 * <P> Date: 2022/4/20:19:26
 * <P> Description:
 */
@Service
public class ContractServiceImpl implements ContractService {
    @Resource
    private ContractMapper contractMapper;

    @Override
    public void addContract(Contract contract) {

        contractMapper.addContract(contract);
    }

    @Override
    public void updateContract(Contract contract) {
        contractMapper.updateContract(contract);
    }

    @Override
    public void deleteContract(int id) {
        contractMapper.deleteContract(id);
    }

    @Override
    public List<Contract> allContract() {
        List<Contract> list = contractMapper.allContract();
        return list;
    }

    @Override
    public Contract getContractById(int id) {
        Contract contract = contractMapper.getContractById(id);
        return contract;
    }

    @Override
    public List<Contract> getOne(Contract contract) {
        List<Contract> list  = contractMapper.getOne(contract);
//        System.out.println("000000000000"+oneContract);
        return list;
    }
}
